USE [DTP]
GO

/****** Object:  Table [dbo].[t_VehicleCards]    Script Date: 11/26/2010 16:28:44 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[t_PersonCards](
	[id] [bigint] IDENTITY(1,1) NOT NULL,
	
	[accidentMemberType] [int] NULL,
            [vehicleNumber] [int] NULL,
            [escape] [int] NULL,
            [fullName] [nvarchar](100) NULL,
            [driverLicenceId] [nvarchar](50) NULL,
            [gender] [int] NULL,
            [birthday] [datetime2](7) NULL,
            [driverExperience] [int] NULL,
            [drivingTime] [int] NULL,
            [socialType] [int] NULL,
            [consequencesType] [int] NULL,
            [nation] [int] NULL,
            [livingPlace] [nvarchar](100) NULL,
            [violationsOfTrafficLaw] [int] NULL,	
	
	[Deleted] [bit] NOT NULL,
 CONSTRAINT [PK_PersonCards] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

ALTER TABLE [dbo].[t_PersonCards]  WITH CHECK ADD  CONSTRAINT [FK_accidentMemberType] FOREIGN KEY([accidentMemberType])
REFERENCES [dbo].[t_Dictionary] ([ID])
GO

ALTER TABLE [dbo].[t_PersonCards] CHECK CONSTRAINT [FK_accidentMemberType]
GO

ALTER TABLE [dbo].[t_PersonCards]  WITH CHECK ADD  CONSTRAINT [FK_escapep] FOREIGN KEY([escape])
REFERENCES [dbo].[t_Dictionary] ([ID])
GO

ALTER TABLE [dbo].[t_PersonCards] CHECK CONSTRAINT [FK_escapep]
GO

ALTER TABLE [dbo].[t_PersonCards]  WITH CHECK ADD  CONSTRAINT [FK_gender] FOREIGN KEY([gender])
REFERENCES [dbo].[t_Dictionary] ([ID])
GO

ALTER TABLE [dbo].[t_PersonCards] CHECK CONSTRAINT [FK_gender]
GO

ALTER TABLE [dbo].[t_PersonCards]  WITH CHECK ADD  CONSTRAINT [FK_socialType] FOREIGN KEY([socialType])
REFERENCES [dbo].[t_Dictionary] ([ID])
GO

ALTER TABLE [dbo].[t_PersonCards] CHECK CONSTRAINT [FK_socialType]
GO

ALTER TABLE [dbo].[t_PersonCards]  WITH CHECK ADD  CONSTRAINT [FK_consequencesType] FOREIGN KEY([consequencesType])
REFERENCES [dbo].[t_Dictionary] ([ID])
GO

ALTER TABLE [dbo].[t_PersonCards] CHECK CONSTRAINT [FK_consequencesType]
GO

ALTER TABLE [dbo].[t_PersonCards]  WITH CHECK ADD  CONSTRAINT [FK_nation] FOREIGN KEY([nation])
REFERENCES [dbo].[t_Dictionary] ([ID])
GO

ALTER TABLE [dbo].[t_PersonCards] CHECK CONSTRAINT [FK_nation]
GO

ALTER TABLE [dbo].[t_PersonCards]  WITH CHECK ADD  CONSTRAINT [FK_violationsOfTrafficLaw] FOREIGN KEY([violationsOfTrafficLaw])
REFERENCES [dbo].[t_Dictionary] ([ID])
GO

ALTER TABLE [dbo].[t_PersonCards] CHECK CONSTRAINT [FK_violationsOfTrafficLaw]
GO

ALTER TABLE [dbo].[t_PersonCards] ADD  DEFAULT ((0)) FOR [Deleted]
GO


